
cmake_minimum_required(VERSION 3.10)

project(wfrestProject)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED on)

include_directories(${PROJECT_SOURCE_DIR}/include)


file(GLOB reverseProxy_source ${CMAKE_CURRENT_SOURCE_DIR}/src/reverseProxySrc/*.cc)

file(GLOB sign_source ${CMAKE_CURRENT_SOURCE_DIR}/src/signServiceSrc/*.cc)

file(GLOB usrInfo_source ${CMAKE_CURRENT_SOURCE_DIR}/src/usrInfoServiceSrc/*.cc)

file(GLOB fileList_source ${CMAKE_CURRENT_SOURCE_DIR}/src/fileListServiceSrc/*.cc)

file(GLOB upload_source ${CMAKE_CURRENT_SOURCE_DIR}/src/uploadServiceSrc/pro/*.cc)

file(GLOB yunStorage_source ${CMAKE_CURRENT_SOURCE_DIR}/src/uploadServiceSrc/con/*.cc)

file(GLOB download_source ${CMAKE_CURRENT_SOURCE_DIR}/src/downloadServiceSrc/*.cc)

set(HOME ../bin)
set(EXECUTABLE_OUTPUT_PATH ${HOME})

add_definitions(-D DEBUG)

########################################################################

add_executable(reverseProxyServer ${reverseProxy_source})

target_compile_options(reverseProxyServer PRIVATE
    -g
)

target_link_libraries(reverseProxyServer PRIVATE 
    ssl
    crypto
    jwt
    srpc
    lz4
    snappy
    protobuf
    wfrest
)

########################################################################

add_executable(signService ${sign_source})

target_compile_options(signService PRIVATE
    -g
)

target_link_libraries(signService PRIVATE 
    ssl
    crypto
    jwt
    srpc
    lz4
    snappy
    protobuf
    wfrest
)

########################################################################


add_executable(usrInfoService ${usrInfo_source})

target_compile_options(usrInfoService PRIVATE
    -g
)

target_link_libraries(usrInfoService PRIVATE 
    srpc
    lz4
    snappy
    protobuf
    wfrest
)


########################################################################


add_executable(fileListService ${fileList_source})

target_compile_options(fileListService PRIVATE
    -g
)

target_link_libraries(fileListService PRIVATE 
    srpc
    lz4
    snappy
    protobuf
    wfrest
)


########################################################################


add_executable(uploadService ${upload_source})

target_compile_options(uploadService PRIVATE
    -g
)

target_link_libraries(uploadService PRIVATE 
    ssl
    crypto
    jwt
    srpc
    lz4
    snappy
    protobuf
    wfrest
    SimpleAmqpClient
)


########################################################################


add_executable(yunStorageService ${yunStorage_source})


target_compile_options(
    yunStorageService PRIVATE
    -std=c++11
    -fno-rtti
)

target_compile_options(
    yunStorageService PRIVATE
    -g
)

target_link_libraries(
    yunStorageService PRIVATE 
    alibabacloud-oss-cpp-sdk
    curl
    ssl
    crypto
    pthread
    jwt
    srpc
    lz4
    snappy
    protobuf
    wfrest
    SimpleAmqpClient
)


########################################################################

add_executable(downloadService ${download_source})

target_compile_options(downloadService PRIVATE
    -g
)

target_link_libraries(downloadService PRIVATE 
    srpc
    lz4
    snappy
    protobuf
    wfrest
)

#set_target_properties(disk PROPERTIES ${CMAKE_CURRENT_SOURCE_DIR})

#target_compile_options(
#    disk PRIVATE
#    -std=c++11
#    -fno-rtti
#    )
#
#target_link_libraries(
#    disk PRIVATE 
#    ssl 
#    crypto 
#    jwt 
#    wfrest
#    SimpleAmqpClient
#    )
#
#target_link_libraries(
#    yunStorage PRIVATE 
#    alibabacloud-oss-cpp-sdk
#    curl
#    ssl 
#    crypto 
#    pthread
#    wfrest
#    SimpleAmqpClient
#    )

